package com.qianbao.finance.sync.modules.elasticsearch.service;

import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @Author：zgh
 * @DATE: 2018/6/22 12:52
 * @version: 0.0.1
 * @Description:
 */
public interface BaseDaoService {

    Map<String, Object> selectByPK(@Param("key") String key, @Param("value") Object value, @Param("databaseName") String databaseName, @Param("tableName") String tableName);

    List<Map<String, Object>> selectByPKs(@Param("key") String key, @Param("valueList") List<Object> valueList, @Param("databaseName") String databaseName, @Param("tableName") String tableName);

    List<Map<String, Object>> selectByPKsLockInShareMode(@Param("key") String key, @Param("valueList") List<Object> valueList, @Param("databaseName") String databaseName, @Param("tableName") String tableName);

    Long count(@Param("databaseName") String databaseName, @Param("tableName") String tableName);

    Long selectMaxPK(@Param("key") String key, @Param("databaseName") String databaseName, @Param("tableName") String tableName);

    Long selectMinPK(@Param("key") String key, @Param("databaseName") String databaseName, @Param("tableName") String tableName);

    List<Map<String, Object>> selectByPKInterval(@Param("key") String key, @Param("minPK") long minPK, @Param("maxPK") long maxPK, @Param("databaseName") String databaseName, @Param("tableName") String tableName);

    List<Map<String, Object>> selectByPKIntervalLockInShareMode(@Param("key") String key, @Param("minPK") long minPK, @Param("maxPK") long maxPK, @Param("databaseName") String databaseName, @Param("tableName") String tableName);

    List<Map<String, Object>> selectByPKIntervalLockInShareModeStep(@Param("key") String key, @Param("minPK") long minPK, @Param("stepSize") long stepSize, @Param("databaseName") String databaseName, @Param("tableName") String tableName);

    List<Map<String, Object>> selectColumnsBySchemaAndTable(@Param("databaseName") String databaseName, @Param("tableName") String tableName);

    List<Map<String,Object>> selectTableName(@Param("databaseName") String databaseName);


}
